<template>
  <div class="weapon">
    <div class="title">武器状态</div>
    <div class="content">
      <el-table
        class="table"
        stripe
        :data="weaponList"
        style="width: 100%; height: 100%"
        :header-cell-style="{
          color: '#fff',
          background: '#0F2737',
        }"
        row-key="id"
      >
        <el-table-column
          align="center"
          prop="name"
          label="武器名称"
          show-overflow-tooltip
        />

        <el-table-column
          align="center"
          prop="troopsType"
          label="规划状态"
          show-overflow-tooltip
        >
          <template #default="{ row }">
            <span v-if="row.status == 1" style="color: #0de70d"> 正常 </span>
            <span v-else-if="row.status == 0" style="color: red"> 损毁 </span>
            <span v-else-if="row.status == 2" style="color: #b87206">
              故障
            </span>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script setup>
import { ref, onMounted, onUnmounted, inject } from "vue";
import { useRoute, useRouter } from "vue-router";
const props = defineProps({});
let emit = defineEmits([""]);
const weaponList = ref([
  {
    name: "武器1",
    status: 1,
  },
  {
    name: "武器2",
    status: 1,
  },
  {
    name: "武器3",
    status: 1,
  },
  {
    name: "武器4",
    status: 2,
  },
  {
    name: "武器4",
    status: 2,
  },
  {
    name: "武器4",
    status: 2,
  },
  {
    name: "武器4",
    status: 2,
  },
  {
    name: "武器4",
    status: 2,
  },
  {
    name: "武器4",
    status: 2,
  },
  {
    name: "武器4",
    status: 2,
  },
  {
    name: "武器40",
    status: 2,
  },
]);
onMounted(() => {});
</script>
<style scoped lang="scss">
.weapon {
  width: 300px;

  height: 35%;
  border: 1px solid #31ecf0;
  box-shadow: 0px 0px 5px 1px #31ecf0;
  position: absolute;
  left: 0;
//   top: 48%;
  bottom: 0;
  z-index: 2;
  background: #1a0936;
  .title {
    height: 30px;
    background: #14384e;
    line-height: 30px;
    text-align: center;
  }
  .content {
    height: calc(100% - 30px);

    position: relative;
    overflow: hidden;
  }

  .table {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
}

:deep() {
  .el-table__expand-icon > .el-icon {
    display: none !important;
  }

  .el-table__header .cell {
    padding: 0 !important;
    text-overflow: unset !important;
    white-space: nowrap !important;
  }

  .cell:empty::after {
    content: "--" !important;
  }

  .el-table {
    border: none;
    --el-table-border-color: 0;
    font-size: 12px;
  }

  .el-table--fit {
    background: transparent;
  }

  .el-table__inner-wrapper {
    border: none;
  }

  .el-table tr {
    color: #fff;
    background: #16222b;
    height: 40px !important;
  }

  .cell {
    white-space: nowrap;
  }

  .el-table td.el-table__cell,
  .el-table th.el-table__cell.is-leaf {
    // border-bottom: 1px solid #00ff3f;
  }

  .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
    background: #121d1f;
  }

  .el-table--striped .el-table__body tr.el-table__row--striped td {
    background: #232e37;
  }

  .el-scrollbar {
    // 横向滚动条
    .el-scrollbar__bar.is-horizontal .el-scrollbar__thumb {
      opacity: 1; // 默认滚动条自带透明度
      height: 8px; // 横向滑块的宽度
      border-radius: 2px; // 圆角度数
      // background-color: rgba(136, 219, 255, 1); // 滑块背景色
      background-color: #3f474d; // 滑块背景色
      box-shadow: 0 0 6px rgba(0, 0, 0, 0.15); // 滑块阴影
    }

    // 纵向滚动条
    .el-scrollbar__bar.is-vertical .el-scrollbar__thumb {
      opacity: 1;
      width: 8px; // 纵向滑块的宽度
      border-radius: 2px;
      // background-color: rgba(136, 219, 255, 1);
      background-color: #3f474d;
      box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
    }
  }

  .el-table__cell,
  .el-table__expanded-cell {
    background: transparent;
  }
}
</style>
